import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path' //  @types/node -D

// https://vite.dev/config/
export default defineConfig({
	plugins: [
		react({
			babel: {
				plugins: [
					['@babel/plugin-proposal-decorators', { legacy: true }],
					['@babel/plugin-proposal-class-properties', { loose: true }]
				]
			}
		})
	],
	resolve: {
		alias: {
			'@': path.resolve(__dirname, './src')
		}
	},
	css: {
		// modules: {
		// 	generateScopedName: '[local]__[hash:base64:5]', // 生成作用域类名, 防止类名冲突
		// 	localsConvention: 'camelCaseOnly' // 转换为驼峰命名
		// },
		preprocessorOptions: {
			scss: {
				// additionalData: `@import "@/styles/variables.scss";`  // 可选：全局引入变量文件
			}
		}
	}
})
